<template>
    <div>

        <!-- 绑定仓库中的count数据 -->
        <input type="number" placeholder="请输入数字" :value="count">
        <br>
        <button @click="minusNumber(5)">减少-5</button>
        <button @click="minusNumber(10)">减少-10</button>
        <button @click="changeCountAsync(666)">异步修改666</button>
        <p>当前数字：{{ count }}</p>
        <p>{{ this.$store.state.list }}</p>
        <p>{{ flitterList }}</p>
    </div>
</template>

<script>
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex';


export default {
    name: "SubMation",
    computed: {
        ...mapState(['count']) // 绑定仓库中的count数据
        ,
        ...mapGetters(['flitterList']) // 绑定仓库中的list数据
    },
    methods: {
        ...mapMutations(['minusNumber']) // 绑定仓库中的addNumber方法
        ,
        ...mapActions(['changeCountAsync']) // 绑定仓库中的changeCountAsync方法

    }

}
</script>

<style></style>